package assist.domain.model;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(detachable = "true")
public class GameStats implements Serializable
{
    @NotPersistent
    private static final long serialVersionUID = 1L;    
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long key;
    
    @Persistent(defaultFetchGroup="true") 
    private Roster roster = new Roster();
    
    /**
     * Persistence of Shots must be managed by the DAO.
     */
    @NotPersistent 
    private Shots shots = new Shots();    

    /**
     * @return the roster
     */
    public Roster getRoster()
    {
        return roster;
    }

    /**
     * @param key the key to set
     */
    public void setKey(Long key)
    {
        this.key = key;
    }

    /**
     * @return the key
     */
    public Long getKey()
    {
        return key;
    }

    public void clearAll()
    {
        this.shots.clearAll();        
    }

    public Shots getShots()
    {
        return this.shots;
    }
}
